package com.easyfile.easyfilemaster.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.*;

import java.util.Date;


/**
 * 用户实体类
 * @author chenpeman
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("user")
public class UserDetail {
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    private String mobile;
    private String username;
    private String sex;
    private String portrait;
    private Double maxCapacity;
    private Double usedCapacity;
    private Integer state;
    private String password;
    private String salt;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @Version
    private Long version;
    @TableLogic
    private Integer deleted;

    /**
     * 转换成userInfo
     *
     * @return the user info
     */
    public UserInfo toUserInfo(){
        return new UserInfo(this);
    }
}
